﻿<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
	<Product Id="*" Name="LuminaDesk" Manufacturer="Trace_studio" Version="1.0.1"
			 Language="1033" Codepage="1252" UpgradeCode="{92688d84-20a9-4009-b146-01db3796df0a}">
		<Package Id="*" InstallerVersion="500" Compressed="yes"
				 InstallScope="perMachine" InstallPrivileges="elevated"
				 Description="Installer for LuminaDesk"/>

		<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>

		<Media Id="1" Cabinet="source.cab" EmbedCab="yes"/>

		<Property Id="VEM" Value="yes"/>

		<!-- UI -->
		<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>

		<UI>
			<UIRef Id="WixUI_InstallDir"/>
			<UIRef Id="WixUI_ErrorProgressText"/>

			<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
					 Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
		</UI>

		<WixVariable Id="WixUIBannerBmp" Value="Resources\banner.png"/>
		<WixVariable Id="WixUIDialogBmp" Value="Resources\dialog.png"/>
		<WixVariable Id="WixUILicenseRtf" Value="Resources\License.rtf"/>

		<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.LuminaDesk.ProjectName) now"/>
		<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>

		<Directory Id="TARGETDIR" Name="SourceDir">
			<!-- Program Files -->
			<Directory Id="ProgramFilesFolder">
				<Directory Id="INSTALLDIR" Name="$(var.LuminaDesk.ProjectName)"/>
			</Directory>

			<!-- Program Menu -->
			<Directory Id="ProgramMenuFolder"/>

			<!-- Local AppData -->
			<Directory Id="LocalAppDataFolder">
				<Directory Id="ApplicationLocalAppDataFolder" Name="$(var.LuminaDesk.ProjectName)"/>
			</Directory>
		</Directory>

		<DirectoryRef Id="INSTALLDIR">
			<Component Id="MainExecutable" Guid="{54E27434-B1A7-4EB7-9F97-847E0B336BAF}">
				<File Id="MainExecutable"
					  Source="$(var.LuminaDesk.TargetPath)" Name="$(var.LuminaDesk.TargetFileName)" KeyPath="yes"/>
			</Component>

			<Component Id="MainExecutableConfig" Guid="{B5CD9CA1-8E4C-41AC-A7BA-1291CB40A916}">
				<File Id="MainExecutableConfig"
					  Source="$(var.LuminaDesk.TargetDir)" Name="$(var.LuminaDesk.TargetFileName).config" KeyPath="yes"/>
			</Component>

			<Component Id="BehaviorsLibrary" Guid="{CDD5E0E6-FF0A-47DA-AE3E-66D6F6FAB3E8}">
				<File Id="BehaviorsLibrary"
					  Source="$(var.LuminaDesk.TargetDir)" Name="Microsoft.Xaml.Behaviors.dll" KeyPath="yes"/>
			</Component>

			<Component Id="CoreLibrary" Guid="{1E9CB31F-C53B-4E83-B593-F30ADC7468CB}">
				<File Id="CoreLibrary"
					  Source="$(var.LuminaDesk.TargetDir)" Name="$(var.LuminaDesk.TargetName).Core.dll" KeyPath="yes"/>
			</Component>

			<Component Id="FrameLibrary" Guid="{9BAED8CA-C9C3-4ECD-8D28-289758577A8E}">
				<File Id="FrameLibrary"
					  Source="$(var.LuminaDesk.TargetDir)" Name="ScreenFrame.dll" KeyPath="yes"/>
			</Component>

			<Component Id="StartupLibrary" Guid="{BF5542A0-B74B-4CBA-9945-C001342759A6}">
				<File Id="StartupLibrary"
					  Source="$(var.LuminaDesk.TargetDir)" Name="StartupAgency.dll" KeyPath="yes"/>
			</Component>

			<Component Id="VisualManifest" Guid="{69BD7D13-0EA9-46F3-9575-EBEEF24A839D}">
				<Condition><![CDATA[VEM = "yes"]]></Condition>
				<File Id="VisualManifest"
					  Source="$(var.LuminaDesk.TargetDir)" Name="$(var.LuminaDesk.TargetName).VisualElementsManifest.xml" KeyPath="yes"/>
			</Component>

			<!-- Language resources -->
			<Directory Id="ResourcesFolder_ar" Name="ar"
					   FileSource="$(var.LuminaDesk.TargetDir)ar">
				<Component Id="CoreResourcesLibrary_ar" Guid="{9C15E424-AE58-4EF0-8CDC-2A590C5C7C2A}">
					<File Id="CoreResourcesLibrary_ar" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_ca" Name="ca"
					   FileSource="$(var.LuminaDesk.TargetDir)ca">
				<Component Id="CoreResourcesLibrary_ca" Guid="{7E91FC9C-C97E-49F8-813F-AA4EB37D60CD}">
					<File Id="CoreResourcesLibrary_ca" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_de" Name="de"
					   FileSource="$(var.LuminaDesk.TargetDir)de">
				<Component Id="CoreResourcesLibrary_de" Guid="{4BE0F7FF-08C3-461E-9FED-4037D40BEB45}">
					<File Id="CoreResourcesLibrary_de" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_elGR" Name="el-GR"
					   FileSource="$(var.LuminaDesk.TargetDir)el-GR">
				<Component Id="CoreResourcesLibrary_elGR" Guid="{D8FA6F67-57B7-45AA-8C81-C323A50787DE}">
					<File Id="CoreResourcesLibrary_elGR" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_es" Name="es"
					   FileSource="$(var.LuminaDesk.TargetDir)es">
				<Component Id="CoreResourcesLibrary_es" Guid="{4329EAB1-6FC9-41F4-8A6E-77FA6C67B15C}">
					<File Id="CoreResourcesLibrary_es" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_fr" Name="fr"
					   FileSource="$(var.LuminaDesk.TargetDir)fr">
				<Component Id="CoreResourcesLibrary_fr" Guid="{B7502D66-6FE8-4E0F-A8D0-42AFFBE82895}">
					<File Id="CoreResourcesLibrary_fr" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_it" Name="it"
					   FileSource="$(var.LuminaDesk.TargetDir)it">
				<Component Id="CoreResourcesLibrary_it" Guid="{7C992E17-3060-405F-BEAB-0F3EF78F307E}">
					<File Id="CoreResourcesLibrary_it" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_jaJP" Name="ja-JP"
					   FileSource="$(var.LuminaDesk.TargetDir)ja-JP">
				<Component Id="CoreResourcesLibrary_jaJP" Guid="{AFE32597-13D8-40D0-887E-9C2B5AB0F9B6}">
					<File Id="CoreResourcesLibrary_jaJP" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_koKR" Name="ko-KR"
					   FileSource="$(var.LuminaDesk.TargetDir)ko-KR">
				<Component Id="CoreResourcesLibrary_koKR" Guid="{F2C43EB4-5522-4A42-A63F-0C229DB356A5}">
					<File Id="CoreResourcesLibrary_koKR" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_nlNL" Name="nl-NL"
					   FileSource="$(var.LuminaDesk.TargetDir)nl-NL">
				<Component Id="CoreResourcesLibrary_nlNL" Guid="{A30E912E-3548-4C10-B92E-E5F4735FE253}">
					<File Id="CoreResourcesLibrary_nlNL" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_plPL" Name="pl-PL"
					   FileSource="$(var.LuminaDesk.TargetDir)pl-PL">
				<Component Id="CoreResourcesLibrary_plPL" Guid="{BFD709FC-0C56-4520-BCBD-657E15CDD02A}">
					<File Id="CoreResourcesLibrary_plPL" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_ptBR" Name="pt-BR"
					   FileSource="$(var.LuminaDesk.TargetDir)pt-BR">
				<Component Id="CoreResourcesLibrary_ptBR" Guid="{1F6F008E-29FE-4BA7-8135-E9D1945199C3}">
					<File Id="CoreResourcesLibrary_ptBR" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_ro" Name="ro"
					   FileSource="$(var.LuminaDesk.TargetDir)ro">
				<Component Id="CoreResourcesLibrary_ro" Guid="{02DC2C14-9F16-4A09-9557-23A38426C77F}">
					<File Id="CoreResourcesLibrary_ro" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_ruRU" Name="ru-RU"
					   FileSource="$(var.LuminaDesk.TargetDir)ru-RU">
				<Component Id="CoreResourcesLibrary_ruRU" Guid="{CC11D857-3E32-44AA-8EA3-B1E2D9686B73}">
					<File Id="CoreResourcesLibrary_ruRU" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_trTR" Name="tr-TR"
					   FileSource="$(var.LuminaDesk.TargetDir)tr-TR">
				<Component Id="CoreResourcesLibrary_trTR" Guid="{7B5931FE-7FC1-4C3C-BBEB-DADB9EDA8AE6}">
					<File Id="CoreResourcesLibrary_trTR" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_ukUA" Name="uk-UA"
					   FileSource="$(var.LuminaDesk.TargetDir)uk-UA">
				<Component Id="CoreResourcesLibrary_ukUA" Guid="{6F8729D5-94CD-4CEA-9DEA-BCED7C809806}">
					<File Id="CoreResourcesLibrary_ukUA" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_zhHans" Name="zh-Hans"
					   FileSource="$(var.LuminaDesk.TargetDir)zh-Hans">
				<Component Id="CoreResourcesLibrary_zhHans" Guid="{D4727E68-157A-495D-B9B8-0CD100291E5E}">
					<File Id="CoreResourcesLibrary_zhHans" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
			<Directory Id="ResourcesFolder_zhHant" Name="zh-Hant"
					   FileSource="$(var.LuminaDesk.TargetDir)zh-Hant">
				<Component Id="CoreResourcesLibrary_zhHant" Guid="{79A2A06D-52F9-4127-B8F3-F7993F121687}">
					<File Id="CoreResourcesLibrary_zhHant" Name="$(var.LuminaDesk.TargetName).Core.resources.dll" KeyPath="yes"/>
				</Component>
			</Directory>
		</DirectoryRef>

		<!-- Shortcut in Program Menu -->
		<DirectoryRef Id="ProgramMenuFolder">
			<Component Id="ApplicationShortcut" Guid="{FEE3D455-9968-475E-9B57-44826C4BF63F}">
				<Shortcut Id="ApplicationProgramMenuShortcut" Name="$(var.LuminaDesk.ProjectName)"
						  Target="[#MainExecutable]" WorkingDirectory="INSTALLDIR"
						  Icon="AppIcon.exe" IconIndex="0">
					<ShortcutProperty Key="System.AppUserModel.ID" Value="[ProductName]"/>
				</Shortcut>
				<RegistryValue Root="HKCU" Key="Software\[ProductName]"
							   Name="ApplicationShortcut" Type="integer" Value="1" KeyPath="yes"/>
			</Component>
		</DirectoryRef>

		<!-- Working Folder in Local AppData -->
		<DirectoryRef Id="ApplicationLocalAppDataFolder">
			<Component Id="ApplicationWorkingFolder" Guid="{62E835D6-6CB7-4853-8B11-4EA52E47B33F}">
				<RemoveFile Id="ApplicationLocalAppDataFiles" Directory="ApplicationLocalAppDataFolder" Name="*.*" On="uninstall"/>
				<RemoveFolder Id="ApplicationLocalAppDataFolder" On="uninstall"/>
				<RegistryValue Root="HKCU" Key="Software\[ProductName]"
							   Name="ApplicationWorkingFolder" Type="integer" Value="1" KeyPath="yes"/>
			</Component>
		</DirectoryRef>

		<Icon Id="AppIcon.exe" SourceFile="$(var.LuminaDesk.TargetPath)"/>
		<Property Id="ARPPRODUCTICON" Value="AppIcon.exe"/>

		<Feature Id="ProductFeature" Level="1">
			<ComponentRef Id="MainExecutable"/>
			<ComponentRef Id="MainExecutableConfig"/>
			<ComponentRef Id="BehaviorsLibrary"/>
			<ComponentRef Id="CoreLibrary"/>
			<ComponentRef Id="FrameLibrary"/>
			<ComponentRef Id="StartupLibrary"/>
			<ComponentRef Id="VisualManifest"/>
			<ComponentRef Id="CoreResourcesLibrary_ar"/>
			<ComponentRef Id="CoreResourcesLibrary_ca"/>
			<ComponentRef Id="CoreResourcesLibrary_de"/>
			<ComponentRef Id="CoreResourcesLibrary_elGR"/>
			<ComponentRef Id="CoreResourcesLibrary_es"/>
			<ComponentRef Id="CoreResourcesLibrary_fr"/>
			<ComponentRef Id="CoreResourcesLibrary_it"/>
			<ComponentRef Id="CoreResourcesLibrary_jaJP"/>
			<ComponentRef Id="CoreResourcesLibrary_koKR"/>
			<ComponentRef Id="CoreResourcesLibrary_nlNL"/>
			<ComponentRef Id="CoreResourcesLibrary_plPL"/>
			<ComponentRef Id="CoreResourcesLibrary_ptBR"/>
			<ComponentRef Id="CoreResourcesLibrary_ro"/>
			<ComponentRef Id="CoreResourcesLibrary_ruRU"/>
			<ComponentRef Id="CoreResourcesLibrary_trTR"/>
			<ComponentRef Id="CoreResourcesLibrary_ukUA"/>
			<ComponentRef Id="CoreResourcesLibrary_zhHans"/>
			<ComponentRef Id="CoreResourcesLibrary_zhHant"/>
			<ComponentRef Id="ApplicationShortcut"/>
			<ComponentRef Id="ApplicationWorkingFolder"/>
		</Feature>

		<!-- Launch after installation -->
		<Property Id="WixShellExecTarget" Value="$(var.LuminaDesk.TargetFileName)"/>
		<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>

		<!-- Clean Current User Run -->
		<CustomAction Id="CleanCurrentUserRun" Directory="TARGETDIR" Execute="immediate" Return="ignore"
					  ExeCommand="[SystemFolder]reg.exe delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v [ProductName] /f"/>
		<InstallExecuteSequence>
			<Custom Action="CleanCurrentUserRun" After="InstallFinalize">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
		</InstallExecuteSequence>
	</Product>
</Wix>